<?php defined('IN_PHPCMS') or exit('Access Denied'); ?><?php include template('phpcms','header'); ?>
<!--begin main-->
<div id="main">
  <!--begin left-->
  <div id="main_l">
    <!--begin 焦点图片，新闻-->
    <div class="cribox_top"></div>
    <div class="cribox_bdr">
      <!--幻灯片-->
      <div id="slide"><?php echo tag('phpcms', 'tag_content_slide', "SELECT a.contentid,a.catid,a.typeid,a.areaid,a.title,a.style,a.thumb,a.keywords,a.description,a.userid,a.updatetime,a.inputtime,a.url FROM `phpcms_content` a, `phpcms_content_position` p WHERE a.contentid=p.contentid AND p.posid=2 AND a.status=99   AND  `thumb`!=''  ORDER BY a.contentid DESC", 0, 5, array (  'class' => 'url',  'target' => '_blank',  'width' => '296',  'height' => '164',));?></div>
      <!--热点文章-->
      <div id="hotnews" class="f_r"> <?php echo tag('phpcms', 'tag_content_one', "SELECT a.contentid,a.catid,a.typeid,a.areaid,a.title,a.style,a.thumb,a.keywords,a.description,a.userid,a.updatetime,a.inputtime,a.url FROM `phpcms_content` a, `phpcms_content_position` p WHERE a.contentid=p.contentid AND p.posid=3 AND a.status=99   ORDER BY a.contentid DESC", 0, 1, array (  'class' => 'c_orange',  'target' => '_blank',  'titlelen' => '32',));?>
        <ul class="text_list">
          <?php echo tag('phpcms', 'tag_content', "SELECT a.contentid,a.catid,a.typeid,a.areaid,a.title,a.style,a.thumb,a.keywords,a.description,a.userid,a.updatetime,a.inputtime,a.url FROM `phpcms_content` a, `phpcms_content_position` p WHERE a.contentid=p.contentid AND p.posid=1 AND a.status=99   ORDER BY a.contentid DESC", 0, 5, array (  'class' => 'url',  'target' => '_blank',  'titlelen' => '35',));?>
        </ul>
      </div>
    </div>
    <div class="cribox_btm"></div>
    <!--end 焦点图片，新闻-->
    <!--begin 全站搜索-->
<?php if(isset($MODULE['search'])) { ?>
<script type="text/javascript">
function set_type(type)
{
$('#type').val(type);

$('#search_tag>span').removeClass('selected');
$('#type_'+type).addClass('selected');
}
</script>
    <form name="search" action="<?php echo $MODULE['search']['url'];?>" target="_blank">
      <div class="search_tag_top mar_10">
        <p id="search_tag"> <span id="type_all" class="selected" onclick="set_type('all')">全部</span> <?php $types = cache_read('search_type.php');?>
          <?php if(is_array($types)) foreach($types AS $type => $name) { ?> <span id="type_<?php echo $type;?>" onclick="set_type('<?php echo $type;?>')"><?php echo $name;?></span> <?php } ?> </p>
      </div>
      <div class="cribox_bdr_1">
        <input type="hidden" name="type" value="all" id="type"/>
        <input type="text" name="q" size="50"/>
        <input type="submit" name="s" id="button" value="搜索" />
      </div>
    </form>
    <div class="cribox_btm"></div>
<?php } ?>
    <!--end 全站搜索-->
    <div class="ad mar_10">
      <script language="javascript" src="data/js.php?id=7"></script>
    </div>
<?php $subcats = subcat('phpcms', 0, 0);?>
<?php if(is_array($subcats)) foreach($subcats AS $catid => $cat) { ?>
    <div class="cat_index">
      <div class="cat_title"><a href="<?php echo $cat['url'];?>"><img src="images/more.gif" alt="更多" /></a>
        <h3><?php echo $cat['catname'];?></h3>
      </div>
      <div class="cat_left">
        <ul class="pic_list">
          <?php echo tag('phpcms', 'tag_content_pic', "SELECT contentid,catid,typeid,areaid,title,style,thumb,keywords,description,userid,updatetime,inputtime,url FROM `phpcms_content` WHERE  status=99   AND  `thumb`!='' ".get_sql_catid($catid)." ORDER BY contentid DESC", 0, 4, array (  'class' => 'url',  'target' => '_blank',  'titlelen' => '14',  'height' => '62',  'width' => '87',));?>
        </ul>
      </div>
      <div class="cat_right">
        <ul class="text_list">
          <?php echo tag('phpcms', 'tag_content', "SELECT contentid,catid,typeid,areaid,title,style,thumb,keywords,description,userid,updatetime,inputtime,url FROM `phpcms_content` WHERE  status=99  ".get_sql_catid($catid)." ORDER BY contentid DESC", 0, 8, array (  'class' => 'url',  'target' => '_blank',  'titlelen' => '50',));?>
        </ul>
      </div>
    </div>
<?php } ?>
    <!--end 栏目列表-->
    <div class="clear"></div>
  </div>
  <!--end left-->
  <!--begin right-->
  <div id="main_r">
<?php if(isset($MODULE['announce'])) { ?>
    <h4><a href="<?php echo $MODULE['announce']['url'];?>"><img src="images/more.gif" alt="更多" /></a>网站公告</h4>
    <div>
      <ul class="text_list">
        <?php echo tag('announce', 'tag_announce', "SELECT * FROM phpcms_announce WHERE `fromdate`<NOW() AND (`todate`>=NOW() OR `todate`='0000-00-00') ORDER BY announceid DESC", 0, 5, array (  'class' => 'url',  'target' => '_blank',  'titlelen' => '46',  'showauthor' => '0',));?>
      </ul>
    </div>
<?php } ?>
<?php if(isset($MODULE['special'])) { ?>
    <h4><a href="<?php echo $MODULE['special']['url'];?>"><img src="images/more.gif" alt="更多" /></a>推荐专题</h4>
    <div class="pic_txt_list">
      <ul>
        <?php echo tag('special', 'tag_special', "SELECT * FROM `phpcms_special`  ORDER BY listorder DESC,specialid DESC", 0, 10, array (  'class' => 'url',  'target' => '_blank',  'width' => '90',  'height' => '62',));?>
      </ul>
    </div>
<?php } ?>
<?php echo block('index', 1);?>
    <h4><a href="tags.php"><img src="images/more.gif" alt="更多" /></a>热门标签</h4>
    <div>
      <ul class="text_list_1">
  <?php $DATA = get("select tag,hits from phpcms_keyword order by listorder desc,hits desc", 10, 0, "", "");foreach($DATA AS $n => $r) { $n++;?>
        <li><a href="tag.php?tag=<?php echo urlencode($r[tag]);?>"><?php echo $r['tag'];?></a>(<?php echo $r['hits'];?>)</li>
  <?php } unset($DATA); ?>
  </ul>
    </div>
<?php if(isset($MODULE['digg'])) { ?>
    <h4><a href="<?php echo $MODULE['digg']['url'];?>"><img src="images/more.gif" alt="更多" /></a>DIGG 周排行</h4>
    <div>
      <ul class="digg_text_list">
<?php $DATA = get("select d.contentid,d.supports,c.title,c.style,c.url from phpcms_digg d left join phpcms_content c on d.contentid=c.contentid where c.status=99 order by d.supports_week desc", 10, 0, "", "");foreach($DATA AS $n => $r) { $n++;?>
<li><span><?php echo $r['supports'];?></span><a href="<?php echo $r['url'];?>" target="_blank" class="<?php echo $r['style'];?>"><?php echo str_cut($r[title], 44);?></a></li>
<?php } unset($DATA); ?>
      </ul>
    </div>
<?php } ?>
<?php if(isset($MODULE['ask'])) { ?>
    <h4><a href="<?php echo $MODULE['ask']['url'];?>"><img src="images/more.gif" alt="更多" /></a>问吧热点</h4>
    <div>
      <ul class="text_list_1">
        <?php echo tag('ask', 'tag_ask', "SELECT * FROM `phpcms_ask` WHERE status>2  ORDER BY askid DESC", 0, 10, array (  'catid' => '0',  'userid' => '',  'flag' => '-1',  'action' => $action,  'urlruleid' => '29',  'class' => 'url',  'target' => '_blank',  'showcatname' => '1',  'titlelen' => '38',));?>
      </ul>
    </div>
<?php } ?>
<?php if(isset($MODULE['vote'])) { ?>
<h4><a href="<?php echo $MODULE['vote']['url'];?>"><img src="images/more.gif" alt="更多" /></a>投票调查</h4>
    <div id="vote_list">  
    <script language='javascript' src='<?php echo $MODULE['vote']['url'];?>vote.php?voteid=1&action=js'></script>
    </div>   
<?php } ?>
<?php if(isset($MODULE['mail']) ) { ?>
    <h4>邮件订阅</h4>
    <div class="pic_txt_list_1">
     <form action="mail/" method="POST">
      E-mail：<input type="text" name="em" id="em">&nbsp;&nbsp;<input type="submit" value="订阅" class="button_style"/>
      </form>
    </div>
<?php } ?>
<?php if(isset($MODULE['link'])) { ?>
    <h4><a href="<?php echo $MODULE['link']['url'];?>"><img src="images/more.gif" alt="更多" /></a>友情链接</h4>
    <div class="pic_txt_list_1"> <?php echo tag('link', 'tag_link_logo', "SELECT * FROM phpcms_link where linktype='1' and passed=1 AND elite=1", 0, 20, array (  'typeid' => '0',  'rownum' => '15',  'showhits' => '是',));?> </div>
    <div class="pic_txt_list_1"> <?php echo tag('link', 'tag_link', "SELECT * FROM phpcms_link where linktype='0' and passed=1 AND elite=1", 0, 18, array (  'typeid' => '0',  'rownum' => '10',  'showhits' => '是',));?> </div>
<?php } ?>

  </div>
  <!--end right-->
</div>
<!--end main-->
<?php include template('phpcms','footer'); ?>